//
//  MTParseXML.h
//  ASITest
//
//  封装得libxml的解析包。
//
//  Created by zrz on 11-7-15.
//  Copyright 2011 pixcoo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "xmlmemory.h"
#import "parser.h"
#import "MTParseXMLObject.h"

@class MTParseXML;
@class MTParseXMLPoint;

@interface MTParseXMLAttr : MTParseXMLObject
{
}

+ (id)objWithPoint:(void*)obj Super:(id)superObj Document:(id)doc;
- (id)initWithPoint:(void*)obj Super:(id)superObj Document:(id)doc;

- (MTParseXMLAttr*)next;
- (MTParseXMLAttr*)prev;
- (MTParseXMLAttr*)child;
- (MTParseXMLAttr*)parent;

@end


@interface MTParseXMLPoint : MTParseXMLObject
{
}

+ (id)objWithPoint:(void*)obj Super:(id)superObj Document:(id)doc;
- (id)initWithPoint:(void*)obj Super:(id)superObj Document:(id)doc;

- (MTParseXMLPoint*)next;
- (MTParseXMLPoint*)prev;
- (MTParseXMLPoint*)child;
- (MTParseXMLPoint*)parent;
- (MTParseXMLPoint*)last;
- (NSString*)getContent;
- (NSString*)getAttr:(NSString*)name;
- (MTParseXML*)Document;
- (MTParseXMLAttr*)getAttr;
- (MTParseXMLPoint*)childWithName:(NSString*)name index:(NSInteger)index;

@end

//封装一下libxml.
@interface MTParseXML : MTParseXMLObject {
	NSError	*error;
	NSStringEncoding encoding;
}

@property (nonatomic , readonly) NSError	*error;
@property (readonly)	NSStringEncoding	encoding;

- (id)initWithData:(NSData*)data;
- (id)initWithPath:(NSString*)path;
- (void)openFile:(NSString*)path;
- (MTParseXMLPoint*)getRootPoint;			

@end
